import request from '@/config/axios'
import type { PageParam } from '@/types/global'

/**
 * 获得商品浏览记录分页
 *
 * @param params 请求参数
 */
export const getBrowseHistoryPage = (params: any) => {
  return request.get({ url: '/product/browse-history/page', params })
}

// 查询商品浏览记录列表
export const getHistoryPage = (params: PageParam) => {
  const finalParams = { ...params, productType: 'SHOP' }; // Add productType
  return request.get({
    url: '/product/history/page',
    params: finalParams
  })
}

// 删除商品浏览记录
export const deleteHistory = (id: number) => {
  const url = `/product/history/delete?id=${id}&productType=SHOP`; // Add productType
  return request.delete({ url })
}
